/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lansupportserver;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JPanel;

/**
 *
 * @author Quan
 */
public class ImagePanel extends JPanel {

    private Image img;

    public void setImg(Image img) {
        this.img = img;
        Dimension size = new Dimension(1366, 768);
        setPreferredSize(size);
        setMinimumSize(size);
        setMaximumSize(size);
        setSize(size);
        setLayout(null);
        this.updateUI();
    }

    public ImagePanel(Image img) {
        super();
        this.img = img;
    }
    
    public ImagePanel() {
        super();
    }

    @Override
    public void paintComponent(Graphics g) {
        g.drawImage(img, 0, 0, null);
    }
}
